using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Kitware.mummy.Runtime;

namespace Kitware.VTK;

/// <summary>
///    vtkAbstractContextBufferId
/// </summary>
/// <remarks>
///    2D array of ids, used for picking.
///
///
/// An 2D array where each element is the id of an entity drawn at the given
/// pixel. The access is not specified in this class.
/// The effective/concrete subclass vtkContextBufferId stores the whole buffer
/// in RAM. The access to a value is fast and independent of the OpenGL.
/// However it requires to first fill the whole buffer by transferring the
/// buffer generated by OpenGL from the VRAM to the RAM. It is inefficient if
/// the context of the scene changes during interaction.
///
/// The effective/concrete subclass vtkOpenGLContextBufferId keeps the buffer id
/// on the VRAM in a texture image. The access to a value is slower than a
/// simple read access to an array but it does not require a large transfer of
/// data from the VRAM to the RAM.
///
/// </remarks>
/// <seealso>
///
/// vtkContextBufferId, vtkOpenGLContextBufferId
/// </seealso>
public abstract class vtkAbstractContextBufferId : vtkObject
{
	/// <summary>
	/// Automatically generated type registration mechanics.
	/// </summary>
	public new const string MRFullTypeName = "Kitware.VTK.vtkAbstractContextBufferId";

	/// <summary>
	/// Automatically generated type registration mechanics.
	/// </summary>
	public new static readonly string MRClassNameKey;

	/// <summary>
	/// Automatically generated type registration mechanics.
	/// </summary>
	static vtkAbstractContextBufferId()
	{
		MRClassNameKey = "class vtkAbstractContextBufferId";
		Methods.RegisterType(Assembly.GetExecutingAssembly(), MRClassNameKey, Type.GetType("Kitware.VTK.vtkAbstractContextBufferId"));
	}

	/// <summary>
	/// Automatically generated constructor - called from generated code.
	/// DO NOT call directly.
	/// </summary>
	public vtkAbstractContextBufferId(IntPtr rawCppThis, bool callDisposalMethod, bool strong)
		: base(rawCppThis, callDisposalMethod, strong)
	{
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern IntPtr vtkAbstractContextBufferId_New(ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount);

	/// <summary>
	///             Undocumented Block
	/// </summary>
	public new static vtkAbstractContextBufferId New()
	{
		vtkAbstractContextBufferId result = null;
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr intPtr = vtkAbstractContextBufferId_New(ref mteStatus, ref mteIndex, ref rawRefCount);
		if (IntPtr.Zero != intPtr)
		{
			result = (vtkAbstractContextBufferId)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, callDisposalMethod: true, out var _);
		}
		return result;
	}

	/// <summary>
	///             Undocumented Block
	/// </summary>
	public vtkAbstractContextBufferId()
		: base(IntPtr.Zero, callDisposalMethod: false, strong: false)
	{
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr rawCppThis = vtkAbstractContextBufferId_New(ref mteStatus, ref mteIndex, ref rawRefCount);
		SetCppThis(rawCppThis, callDisposalMethod: true, (mteStatus != 0 && rawRefCount >= 2) ? true : false);
	}

	/// <summary>
	/// Automatically generated protected Dispose method - called from
	/// public Dispose or the C# destructor. DO NOT call directly.
	/// </summary>
	protected override void Dispose(bool disposing)
	{
		base.Dispose(disposing);
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkAbstractContextBufferId_Allocate_01(HandleRef pThis);

	/// <summary>
	/// Allocate the memory for at least Width*Height elements.
	/// \pre positive_width: GetWidth()&gt;0
	/// \pre positive_height: GetHeight()&gt;0
	/// </summary>
	public virtual void Allocate()
	{
		vtkAbstractContextBufferId_Allocate_01(GetCppThis());
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern IntPtr vtkAbstractContextBufferId_GetContext_02(HandleRef pThis, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount);

	/// <summary>
	/// Set/Get the OpenGL context owning the texture object resource.
	/// </summary>
	public virtual vtkRenderWindow GetContext()
	{
		vtkRenderWindow vtkRenderWindow2 = null;
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr intPtr = vtkAbstractContextBufferId_GetContext_02(GetCppThis(), ref mteStatus, ref mteIndex, ref rawRefCount);
		if (IntPtr.Zero != intPtr)
		{
			vtkRenderWindow2 = (vtkRenderWindow)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, callDisposalMethod: true, out var found);
			if (found)
			{
				vtkRenderWindow2.Register(null);
			}
		}
		return vtkRenderWindow2;
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern int vtkAbstractContextBufferId_GetHeight_03(HandleRef pThis);

	/// <summary>
	/// Number of rows. Initial value is 0.
	/// </summary>
	public virtual int GetHeight()
	{
		return vtkAbstractContextBufferId_GetHeight_03(GetCppThis());
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern long vtkAbstractContextBufferId_GetNumberOfGenerationsFromBase_04(HandleRef pThis, string type);

	/// <summary>
	///             Undocumented Block
	/// </summary>
	public override long GetNumberOfGenerationsFromBase(string type)
	{
		return vtkAbstractContextBufferId_GetNumberOfGenerationsFromBase_04(GetCppThis(), type);
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern long vtkAbstractContextBufferId_GetNumberOfGenerationsFromBaseType_05(string type);

	/// <summary>
	///             Undocumented Block
	/// </summary>
	public new static long GetNumberOfGenerationsFromBaseType(string type)
	{
		return vtkAbstractContextBufferId_GetNumberOfGenerationsFromBaseType_05(type);
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern long vtkAbstractContextBufferId_GetPickedItem_06(HandleRef pThis, int x, int y);

	/// <summary>
	/// Return item under abscissa x and ordinate y.
	/// Abscissa go from left to right.
	/// Ordinate go from bottom to top.
	/// The return value is -1 if there is no item.
	/// \pre is_allocated: IsAllocated()
	/// \post valid_result: result&gt;=-1
	/// </summary>
	public virtual long GetPickedItem(int x, int y)
	{
		return vtkAbstractContextBufferId_GetPickedItem_06(GetCppThis(), x, y);
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern int vtkAbstractContextBufferId_GetWidth_07(HandleRef pThis);

	/// <summary>
	/// Number of columns. Initial value is 0.
	/// </summary>
	public virtual int GetWidth()
	{
		return vtkAbstractContextBufferId_GetWidth_07(GetCppThis());
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern int vtkAbstractContextBufferId_IsA_08(HandleRef pThis, string type);

	/// <summary>
	///             Undocumented Block
	/// </summary>
	public override int IsA(string type)
	{
		return vtkAbstractContextBufferId_IsA_08(GetCppThis(), type);
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern byte vtkAbstractContextBufferId_IsAllocated_09(HandleRef pThis);

	/// <summary>
	/// Tell if the buffer has been allocated.
	/// </summary>
	public virtual bool IsAllocated()
	{
		return (vtkAbstractContextBufferId_IsAllocated_09(GetCppThis()) != 0) ? true : false;
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern byte vtkAbstractContextBufferId_IsSupported_10(HandleRef pThis);

	/// <summary>
	/// Returns if the context supports the required extensions.
	/// \pre context_is_set: this-&gt;GetContext()!=0
	/// </summary>
	public virtual bool IsSupported()
	{
		return (vtkAbstractContextBufferId_IsSupported_10(GetCppThis()) != 0) ? true : false;
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern int vtkAbstractContextBufferId_IsTypeOf_11(string type);

	/// <summary>
	///             Undocumented Block
	/// </summary>
	public new static int IsTypeOf(string type)
	{
		return vtkAbstractContextBufferId_IsTypeOf_11(type);
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern IntPtr vtkAbstractContextBufferId_NewInstance_13(HandleRef pThis, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount);

	/// <summary>
	///             Undocumented Block
	/// </summary>
	public new vtkAbstractContextBufferId NewInstance()
	{
		vtkAbstractContextBufferId result = null;
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr intPtr = vtkAbstractContextBufferId_NewInstance_13(GetCppThis(), ref mteStatus, ref mteIndex, ref rawRefCount);
		if (IntPtr.Zero != intPtr)
		{
			result = (vtkAbstractContextBufferId)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, callDisposalMethod: true, out var _);
		}
		return result;
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkAbstractContextBufferId_ReleaseGraphicsResources_14(HandleRef pThis);

	/// <summary>
	/// Release any graphics resources that are being consumed by this object.
	/// Default implementation is empty.
	/// </summary>
	public virtual void ReleaseGraphicsResources()
	{
		vtkAbstractContextBufferId_ReleaseGraphicsResources_14(GetCppThis());
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern IntPtr vtkAbstractContextBufferId_SafeDownCast_15(HandleRef o, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount);

	/// <summary>
	///             Undocumented Block
	/// </summary>
	public new static vtkAbstractContextBufferId SafeDownCast(vtkObjectBase o)
	{
		vtkAbstractContextBufferId vtkAbstractContextBufferId2 = null;
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr intPtr = vtkAbstractContextBufferId_SafeDownCast_15(o?.GetCppThis() ?? default(HandleRef), ref mteStatus, ref mteIndex, ref rawRefCount);
		if (IntPtr.Zero != intPtr)
		{
			vtkAbstractContextBufferId2 = (vtkAbstractContextBufferId)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, callDisposalMethod: true, out var found);
			if (found)
			{
				vtkAbstractContextBufferId2.Register(null);
			}
		}
		return vtkAbstractContextBufferId2;
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkAbstractContextBufferId_SetContext_16(HandleRef pThis, HandleRef context);

	/// <summary>
	/// Set/Get the OpenGL context owning the texture object resource.
	/// </summary>
	public virtual void SetContext(vtkRenderWindow context)
	{
		vtkAbstractContextBufferId_SetContext_16(GetCppThis(), context?.GetCppThis() ?? default(HandleRef));
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkAbstractContextBufferId_SetHeight_17(HandleRef pThis, int _arg);

	/// <summary>
	/// Set the number of rows. Initial value is 0.
	/// </summary>
	public virtual void SetHeight(int _arg)
	{
		vtkAbstractContextBufferId_SetHeight_17(GetCppThis(), _arg);
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkAbstractContextBufferId_SetValues_18(HandleRef pThis, int srcXmin, int srcYmin);

	/// <summary>
	/// Copy the contents of the current read buffer to the internal structure
	/// starting at lower left corner of the framebuffer (srcXmin,srcYmin).
	/// \pre is_allocated: this-&gt;IsAllocated()
	/// </summary>
	public virtual void SetValues(int srcXmin, int srcYmin)
	{
		vtkAbstractContextBufferId_SetValues_18(GetCppThis(), srcXmin, srcYmin);
	}

	[DllImport("Kitware.VTK.RenderingContext2D.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkAbstractContextBufferId_SetWidth_19(HandleRef pThis, int _arg);

	/// <summary>
	/// Set the number of columns. Initial value is 0.
	/// </summary>
	public virtual void SetWidth(int _arg)
	{
		vtkAbstractContextBufferId_SetWidth_19(GetCppThis(), _arg);
	}
}
